<?php
/************************************************************/
/* Nhung gam mau chu dao                                      */
/************************************************************/
$bgcolor1 = "#ffffff";
$bgcolor2 = "#E2E8D6";
$bgcolor3 = "#F7F7F7";
$bgcolor4 = "#FFFFF4";
$bgcolor5 = "#F4F4F4";
$textcolor1 = "#000000";
$textcolor2 = "#000000";
/************************************************************/
/* Xac lap mo va dong bang                    */
/************************************************************/
function OpenTable_box() {
echo "<table cellpadding=\"5\" cellspacing=\"0\" width=\"100%\" bordercolor=\"#999999\" style=\"border-collapse: collapse\">\n";
echo "	<tr>\n";
echo "		<td background=\"images/CKT_themes/bg_tieude.gif\" style=\"padding-left: 5px\">";
}

function OpenTable() {
echo "<table cellpadding=\"5\" cellspacing=\"0\" width=\"100%\" bordercolor=\"#999999\" style=\"border-collapse: collapse\">\n";
echo "	<tr>\n";
echo "		<td style=\"padding-left: 5px\">";
}
function CloseTable() {
echo"</td>\n";
echo "	</tr>\n";
echo "</table><br>\n";
}
function OpenTable2() {
global $bgcolor1;
echo"<table border=\"0\" cellpadding=\"6\" style=\"border-collapse: collapse\" cellspacing=\"1\">\n"
. "<tr>\n<td>\n<table border=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" width=\"100%\" bgcolor=\"#E2E8D6\">\n"
. "<tr>\n<td>\n<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellspacing=\"1\">\n"
. "<tr>\n<td bgcolor=\"$bgcolor1\">\n<table border=\"0\" cellpadding=\"2\" style=\"border-collapse: collapse\" width=\"100%\" cellspacing=\"2\">\n"
. "<tr>\n<td style=\"text-align: justify\">";
}
function CloseTable2() {
global $themepath;
echo"</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n";
}
function OpenTable3() {
global $bgcolor5, $bgcolor2;
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td style=\"border: 1px solid $bgcolor5\">\n"
. "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\" bgcolor=\"$bgcolor2\">\n<tr>\n<td>";
}
function CloseTable3() {
global $themepath;
echo"</td></tr></table>\n</td>\n</tr>\n<tr>\n<td><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"150\" height=\"3\"></td>\n</tr>\n</table>\n";
}
function OpenTable4() {
global $bgcolor5, $bgcolor2;
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td>\n"
. "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">\n<tr>\n<td>";
}
function CloseTable4() {
global $themepath;
echo"</td></tr></table>\n</td>\n</tr>\n<tr>\n<td><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"3\"></td>\n</tr>\n</table>\n";
}
function OpenTable5() {
global $bgcolor5, $bgcolor2;
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td>\n"
. "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">\n<tr>\n<td>";
}
function CloseTable5() {
global $themepath;
echo"</td></tr></table>\n</td>\n</tr>\n<tr>\n<td><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"3\"></td>\n</tr>\n</table>\n";
}
/************************************************************/
/* The hien ten module                          */
/************************************************************/
function mod_title() {
global $module_name, $adminfile, $home, $module_title, $page_title2;//TH04 / 18.07.06
if(defined('NV_ADMIN')) { $tentrang =  "<a href=\"".$adminfile.".php\">".$module_title."</a>"; }
elseif($home==1) { $tentrang =  "<a href=\"index.php\">".$module_title."</a>"; }
else {
$tentrang = "<a href=\"modules.php?name=$module_name\">$module_title</a>";
if($page_title2!="") $tentrang = "$tentrang &raquo; $page_title2";
}//END
echo "<table border=\"0\" width=\"100%\" cellpadding=\"3\" style=\"border-collapse: collapse\">\n";
echo "<tr>\n";
echo "<td><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/mod_titl.gif\" width=\"8\" height=\"9\"> <b>$tentrang</b></td>\n";
echo "</tr>\n";
echo "</table>\n";
}
/************************************************************/
/* Tieu de                                         */
/************************************************************/
function title($text) {
OpenTable();
echo "<font class=\"title\"><b>&nbsp;$text</b></font>";
CloseTable();
echo "<br>";
}
/************************************************************/
/* Ten chu de                            */
/************************************************************/
function categoryname($cat_name) {
global $themepath;
echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\" height=\"20\">\n";
echo "	<tr>\n";
echo "		<td background=\"images/CKT_themes/bg_tieude.gif\" style=\"padding-left: 5px\" class=\"storytitle\"><a href=\"".INCLUDE_PATH."modules.php?name=News&op=viewcat&catid=$cat_id\">$cat_name</a></td>\n";
echo "	</tr>\n";
echo "</table>\n";
}
/************************************************************/
/* Phan dau trang                                 */
/************************************************************/
function themeheader() {
global $datafold, $adminfile, $module_title, $module_name, $name, $prefix, $db;
$timeadjust = ($hourdiff * 60);   
$weekdayNames = array(_SUN2, _MON2, _TUE2, _WED2, _THU2, _FRI2, _SAT2);
echo"<body bgcolor=\"#529B0A\" topmargin=\"1\">\n\n";

echo "<table border=\"0\" width=\"770\" align=\"center\" cellpadding=\"0\" style=\"border-collapse: collapse\" bgcolor=\"#DCDCDC\">\n";
echo "	<tr>\n";
/*echo "		<td valign=\"top\">\n";
echo "		<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "			<tr>\n";
echo "				<td height=\"77\">&nbsp;</td>\n";
echo "			</tr>\n";
echo "			<tr>\n";
echo "				<td bgcolor=\"#D7D7D7\" height=\"82\">&nbsp;</td>\n";
echo "			</tr>\n";
echo "		</table>\n";
echo "		</td>\n";

echo "		<td valign=\"top\" width=\"46\" background==\"".INCLUDE_PATH."themes/CKT/images/bg_01.gif\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/flw_01.jpg\" width=\"46\" height=\"161\"></td>\n";
*/
echo "		<td valign=\"top\" bgcolor=\"#FFFFFF\" width=\"2\">\n";
echo "		<img border=\"0\" src==\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"2\" height=\"1\"></td>\n";
//Mau nen background cua phan giua trang
echo "		<td valign=\"top\" width=\"770\" bgcolor=\"#F7FBFF\">\n";
echo "		<table border=\"0\" width=\"770\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
##############Banner#####################
echo "			<tr>\n";
echo "				<td width=\"770\" height=\"\">\n";
echo "<table border=\"0\" width=\"770\" id=\"table1\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "	<tr>\n";
echo "		<td valign=\"top\"  align=center>\n";
echo "		<table border=\"0\" width=\"770\" id=\"table2\" cellpadding=\"0\" style=\"border-collapse: collapse\"  align=center>\n";
echo "			<tr>\n";
echo "<td valign=\"top\" align=\"left\">";
echo '<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
		<tr>
			<td colspan="2">
			<img src="'.INCLUDE_PATH.'images/contact1_01.jpg" width="770" height="194" alt="">
			</td>
		</tr>
		<tr>
			<td background="'.INCLUDE_PATH.'images/contact1_03.jpg" width="25%">
			<img src="'.INCLUDE_PATH.'images/contact1_02.jpg" width="196" height="33" alt=""></td>
			<td background="'.INCLUDE_PATH.'images/contact1_03.jpg"><font face="Verdana" style="font-size: 9pt" color="#008000"><b>
			<marquee width="560" height="26" scrolldelay="120">&#272;o&#224;n k&#7871;t - V&#432;&#7907;t kh&#243; - S&#225;ng t&#7841;o 
			</marquee></b></font></td>
		</tr>
	</table>';
echo "</td>";
echo "</tr>\n";
###############Tin news js################
//echo "<tr valign=top>\n";
//echo "<td bgcolor=\"#333333\" align=\"left\" width=\"770\" height=\"20\" valign=top>\n";
$imgnews_start="left";
$imgnews_start_size="120";
$news_start_path="uploads/News/pic";
$res_new = $db->sql_query("SELECT sid, title FROM ".$prefix."_biz ORDER BY sid DESC LIMIT 10");
while(list($sid1, $title_new) = $db->sql_fetchrow($res_new)) {
$title_new = str_replace("'","",$title_new);
$titlenew[] =$title_new;
$sidnew[] = "modules.php?name=News&op=viewst&sid=$sid1";
}	
echo "<SCRIPT language=javascript type=text/javascript>"
. "var theSummaries = new Array('$titlenew[0]','$titlenew[1]','$titlenew[2]','$titlenew[3]','$titlenew[4]','$titlenew[5]','$titlenew[6]');"
. "var theSiteLinks = new Array('$sidnew[0]', '$sidnew[1]', '$sidnew[2]', '$sidnew[3]', '$sidnew[4]', '$sidnew[5]', '$sidnew[6]');"
. "</SCRIPT></left>"
. "<SCRIPT src=\"".INCLUDE_PATH."js/news.js\"  type=\"text/javascript\">\n";
echo"</SCRIPT></DIV>";
//echo "</td>\n";
// End tin news js
echo "		</table>\n";
echo "		</td>\n";
echo"</td>\n";
echo "	</tr>\n";
echo "</table>\n";
echo "				</td>\n";
echo "			</tr>\n";
################################
echo "			<tr>\n";
echo "				<td valign=\"top\">\n";
echo "				<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "					<tr>\n";
if (!defined('NV_ADMIN')) {
//echo "<!-- Block trai -->					\n";
echo "						<td width=\"145\" valign=\"top\">\n";
echo "						<table border=\"0\" width=\"145\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "							<tr>\n";
echo "								<td>";
include("".INCLUDE_PATH."themes/CKT/menu/menu.php");
echo"</td>\n";
echo "							</tr>\n";
echo "							<tr>					\n";
echo "								<td>";
blocks(left,$name);
if (file_exists("".INCLUDE_PATH."banners/nvbanners/banners3_1176643218.php")) { 
include("".INCLUDE_PATH."banners/nvbanners/banners3_1176643218.php"); }
echo "</td>							\n";
echo "	</tr>\n";
echo "	</table>\n";
echo "	</td>\n";
//echo "<!-- //Block trai -->		
}
echo "	<td width=\"2\">\n";
echo "	<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"2\" height=\"1\"></td>\n";
echo "	<td valign=\"top\">";
if($home !=1) {
mod_title();
}	
}
/************************************************************/
/* Phan duoi trang                                 */
/************************************************************/
function themefooter() {
global $index, $db, $prefix, $themepath, $module_name, $c, $home, $hourdiff;
echo"<img src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"5\" height=\"1\"></td>\n";
echo"</td>\n";
echo "						<td width=\"2\">\n";
echo "						<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"2\" height=\"1\"></td>\n";
//echo "<!-- block phai -->						\n";
if ($index == 1 || $index == 2) {
echo "						<td width=\"145\" valign=\"top\">\n";
echo "						<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "							<tr>\n";
echo "								<td>";
blocks(right,$name);
if (file_exists("".INCLUDE_PATH."banners/nvbanners/banners2_1176570587.php")) { 
include("".INCLUDE_PATH."banners/nvbanners/banners2_1176570587.php"); }
echo"</td>\n";
echo "							</tr>\n";
echo "							<tr>\n";
echo "								<td>";
if (file_exists("".INCLUDE_PATH."banners/nvbanners/banners2_1130667498.php")) {
include("".INCLUDE_PATH."banners/nvbanners/banners2_1130667498.php");
}
echo"</td>\n";
echo "							</tr>\n";
echo "						</table>\n";
echo "						</td>\n";
}
//echo "<!-- //block phai -->						\n";
echo "					</tr>\n";
echo "				</table>\n";
echo "				</td>\n";
echo "			</tr>\n";
echo "			<tr>\n";
echo "				<td>&nbsp;</td>\n";
echo "			</tr>\n";
echo "			<tr>\n";
echo "				<td bgcolor=\"#333333\" height=\"2\">\n";
echo "				<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"2\"></td>\n";
echo "			</tr>\n";
echo "			<tr>\n";
echo "				<td height=\"2\">\n";
echo "				<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"2\"></td>\n";
echo "			</tr>\n";
echo "		</table>\n";
echo "		</td>\n";
echo "		<td valign=\"top\" bgcolor=\"#FFFFFF\" width=\"2\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"2\" height=\"1\"></td>\n";
/*echo "		<td valign=\"top\" width=\"46\" background=\"".INCLUDE_PATH."themes/CKT/images/bg_02.gif\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/flw_02.jpg\" width=\"46\" height=\"145\"></td>\n";
echo "		<td valign=\"top\">\n";
echo "		<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "			<tr>\n";
echo "				<td height=\"77\">&nbsp;</td>\n";
echo "			</tr>\n";
echo "			<tr>\n";
echo "				<td bgcolor=\"#D7D7D7\" height=\"82\">&nbsp;</td>\n";
echo "			</tr>\n";
echo "		</table>\n";
echo "		</td>\n";
*/
echo "	</tr>\n";
//echo "	<tr>\n";
//echo "		<td>\n";
//echo "		<table border=\"0\" width=\"100%\" cellpadding=\"0\" bgcolor=\"#D7D7D7\" style=\"border-collapse: collapse\" height=\"82\">\n";
//echo "			<tr>\n";
//echo "				<td>&nbsp;</td>\n";
//echo "			</tr>\n";
//echo "		</table>\n";
//echo "		</td>\n";
//echo "		<td valign=\"bottom\">\n";
//echo "		<table border=\"0\" width=\"100%\" cellpadding=\"0\" bgcolor=\"#D7D7D7\" style=\"border-collapse: collapse\" height=\"82\">\n";
//echo "			<tr>\n";
//echo "				<td>&nbsp;</td>\n";
//echo "			</tr>\n";
//echo "		</table>\n";
//echo "		</td>\n";
//echo "		<td valign=\"bottom\" bgcolor=\"#FFFFFF\" width=\"2\">\n";
//echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"2\" height=\"1\"></td>\n";
//echo "		<td valign=\"bottom\">\n";
echo "		<table align=\"center\" border=\"0\" width=\"790\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
//echo "			<tr>\n";
//echo "				<td bgcolor=\"#D7D7D7\" height=\"82\" align=\"center\">";
//footmsg();
//echo"</td>\n";
echo '<div align="center">
<table id="table2" width="775" height="62" align="center" border="0" cellpadding="0" cellspacing="0">
	<tr>
		
		<td height="62" background="'.INCLUDE_PATH.'images/footer_06.jpg" width="177">
			<p align="center"><font face="Verdana" size="1">Designed by <br>
			<b><a href="http://www.halovn.com">
			<span style="text-decoration: none"><font color="#EA3D24">HALOVN</font></span></a></b></font></td>
		<td height="62" background="'.INCLUDE_PATH.'images/footer_07.jpg" width="598">
			<font face="Verdana" size="1"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
			Bản quyền thuộc về Công ty Cổ phần 26</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
			Địa chỉ: Khu Công nghiệp Sài Đồng - Long Biên - Hà Nội<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
			Điện thoại: 04.8751461, 04.8751463; Fax: 04.8751460<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
			Email: 26jsc@has.com.vn, x26jschn@vnn.vn</font></td>
			</tr>
	</table>
</div>
';
//echo "			</tr>\n";
echo "		</table>\n";
echo "		</td>\n";
echo "		<td valign=\"top\" bgcolor=\"#FFFFFF\" width=\"2\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"2\" height=\"1\"></td>\n";
echo "		<td valign=\"top\">\n";
/*echo "		<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\" height=\"82\" bgcolor=\"#D7D7D7\">\n";
echo "			<tr>\n";
echo "				<td>&nbsp;</td>\n";
echo "			</tr>\n";
echo "		</table>\n";
*/
echo "		</td>\n";
echo "		<td valign=\"top\">\n";
/*echo "		<table border=\"0\" width=\"100%\" cellpadding=\"0\" bgcolor=\"#D7D7D7\" style=\"border-collapse: collapse\" height=\"82\">\n";
echo "			<tr>\n";
echo "				<td>&nbsp;</td>\n";
echo "			</tr>\n";
echo "		</table>\n";
*/
echo "		</td>\n";
echo "	</tr>\n";
echo "</table\n";
/**********************QUANG CAO 2 BEN************************/

//Phan quang cao ben phai\\  
global $prefix,$db; 
echo "<DIV id=divAdRight style=\"RIGHT: -110px; WIDTH: 115px; POSITION: absolute; TOP: 71px\" align=\"right\">";
$sql = "select quangcao_id, quangcao_web, quangcao_url, quangcao_img from ".$prefix."_quangcao where quangcao_type='3' order by quangcao_id"; 
$result = $db->sql_query($sql); 
while ($row = $db->sql_fetchrow($result)) { 
$trangweb = $row['quangcao_web']; 
$weburl = $row['quangcao_url']; 
$weblogo = $row['quangcao_img']; 
echo  "&nbsp;<a href=$weburl target=\"_blank\" title=\"$trangweb\"><img src=$weblogo WIDTH=\"100\" border=\"0\"></a><br><b>$trangweb</b><br>"; 
} 
echo "</DIV>\n";

//Phan quang cao ben trai\\
echo "<DIV id=divAdLeft style=\"LEFT: -110px; WIDTH: 115px; POSITION: absolute; TOP: 71px\">";
$sql2 = "select quangcao_id, quangcao_web, quangcao_url, quangcao_img from ".$prefix."_quangcao where quangcao_type='2' order by quangcao_id"; 
$result2 = $db->sql_query($sql2); 
while ($row2 = $db->sql_fetchrow($result2)) { 
$trangweb2 = $row2['quangcao_web']; 
$weburl2 = $row2['quangcao_url']; 
$weblogo2 = $row2['quangcao_img']; 
echo "&nbsp;<a href=$weburl2 target=\"_blank\" title=\"$trangweb2\"><img src=$weblogo2 WIDTH=\"100\" border=\"0\"></a><br><b>$trangweb2</b><br>"; 
} 
echo"</DIV>\n";
echo "    <SCRIPT language=JavaScript>\n";
echo "    var adRWidth=120;\n";
echo "    var adLWidth=1000;\n";
echo "        function FloatTopDiv()\n";
echo "        {\n";
echo "            startX = document.body.clientWidth - adRWidth, startY = 71;\n";
echo "            var ns = (navigator.appName.indexOf(\"Netscape\") != -1);\n";
echo "            var d = document;\n";
echo "                 \n";
echo "            if (document.body.clientWidth < 980) startX = -adRWidth;\n";
echo "\n";
echo "             \n";
echo "            function ml(id)\n";
echo "            {\n";
echo "                var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];\n";
echo "                if(d.layers)el.style=el;\n";
echo "                el.sP=function(x,y){this.style.left=x;this.style.top=y;};\n";
echo "                el.x = startX;\n";
echo "                el.y = startY;\n";
echo "                return el;\n";
echo "            }\n";
echo "             \n";
echo "            window.stayTopLeft=function()\n";
echo "            {\n";
echo "                 \n";
echo "                if (document.documentElement && document.documentElement.scrollTop)\n";
echo "                    var pY = ns ? pageYOffset : document.documentElement.scrollTop;\n";
echo "                else if (document.body)\n";
echo "                    var pY = ns ? pageYOffset : document.body.scrollTop;\n";
echo "\n";
echo "                if (document.body.scrollTop > 71){startY = 3} else {startY = 71};\n";
echo "                ftlObj.y += (pY + startY - ftlObj.y)/8;\n";
echo "                ftlObj.sP(ftlObj.x, ftlObj.y);\n";
echo "                setTimeout(\"stayTopLeft()\", 1);\n";
echo "            }\n";
echo "            ftlObj = ml(\"divAdRight\");\n";
echo "            stayTopLeft();\n";
echo "        }\n";
echo "\n";
echo "    function FloatTopDiv2()\n";
echo "        {\n";
echo "            startX2 = document.body.clientWidth - adLWidth, startY2 = 71;\n";
echo "            var ns2 = (navigator.appName.indexOf(\"Netscape\") != -1);\n";
echo "            var d2 = document;\n";
echo "                 \n";
echo "            if (document.body.clientWidth < 980) startX2 = -adLWidth;\n";
echo "\n";
echo "             \n";
echo "            function ml2(id)\n";
echo "            {\n";
echo "                var el2=d2.getElementById?d2.getElementById(id):d2.all?d2.all[id]:d2.layers[id];\n";
echo "                if(d2.layers)el2.style=el2;\n";
echo "                el2.sP=function(x,y){this.style.left=x;this.style.top=y;};\n";
echo "                el2.x = startX2;\n";
echo "                el2.y = startY2;\n";
echo "                return el2;\n";
echo "            }\n";
echo "             \n";
echo "            window.stayTopLeft2=function()\n";
echo "            {\n";
echo "                if (document.body.clientWidth < 980)\n";
echo "                {\n";
echo "                    ftlObj2.x = - 115;ftlObj2.y = 0;    ftlObj2.sP(ftlObj2.x, ftlObj2.y);\n";
echo "                }\n";
echo "                else\n";
echo "                {\n";
echo "                if (document.documentElement && document.documentElement.scrollTop)\n";
echo "                    var pY2 = ns2 ? pageYOffset : document.documentElement.scrollTop;\n";
echo "                else if (document.body)\n";
echo "                    var pY2 = ns2 ? pageYOffset : document.body.scrollTop;\n";
echo "\n";
echo "                if (document.body.scrollTop > 71){startY2 = 3} else {startY2 = 71};\n";
echo "\n";
echo "                if (document.body.clientWidth >= 1024)\n";
echo "                {\n";
echo "                    ftlObj2.x = 0;ftlObj2.y += (pY2 + startY2 - ftlObj2.y)/32;    ftlObj2.sP(ftlObj2.x, ftlObj2.y);\n";
echo "                }\n";
echo "                else\n";
echo "                {             \n";
echo "                 \n";
echo "                ftlObj2.x = startX2;\n";
echo "                ftlObj2.y += (pY2 + startY2 - ftlObj2.y)/32;\n";
echo "                ftlObj2.sP(ftlObj2.x, ftlObj2.y);\n";
echo "                }\n";
echo "                }\n";
echo "                setTimeout(\"stayTopLeft2()\", 1);\n";
echo "            }\n";
echo "             \n";
echo "            ftlObj2 = ml2(\"divAdLeft\");\n";
echo "            stayTopLeft2();\n";
echo "             \n";
echo "        }\n";
echo "\n";
echo "\n";
echo "        function ShowAdDiv()\n";
echo "        {\n";
echo "            var objAdDivRight = document.getElementById(\"divAdRight\");\n";
echo "            var objAdDivLeft = document.getElementById(\"divAdLeft\");\n";
echo "\n";
echo "            if (document.body.clientWidth < 980)\n";
echo "            {\n";
echo "                objAdDivRight.style.left = - adRWidth;\n";
echo "                objAdDivLeft.style.left = - adLWidth;\n";
echo "            }\n";
echo "            else\n";
echo "            {\n";
echo "                objAdDivLeft.style.left = 0;\n";
echo "                objAdDivRight.style.left = document.body.clientWidth - adRWidth;\n";
echo "            }\n";
echo "            FloatTopDiv();\n";
echo "            FloatTopDiv2();\n";
echo "        }\n";
echo "        ShowAdDiv();\n";
echo "        LComplete = 1;\n";
echo "    </SCRIPT>\n";


/**************************HET QUANG CAO 2 BEN******************************/

}
/************************************************************/
/* Tin tuc tren trang nhat                   */
/************************************************************/
function themeindex ($aid, $datetime, $title, $hometext, $story_pic, $notes, $story_link, $com_link, $tot_hits,$mau = 0) {
global $catnewshomeimg, $sizecatnewshomeimg, $newshome, $catnewshome, $datafold, $sitename, $print, $home;
include ("".INCLUDE_PATH."".$datafold."/config_News.php");
if($aid !="") {
$aid = "$aid - ";
} else {
$aid = "";
}
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">"
. "  <tr><td width=\"100%\" style=\"padding-left:5; padding-right: 5; padding-top: 5\">";    
echo"<table border=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" width=\"100%\"><tr>";
if (($newshome ==1) AND ($catnewshome==1) AND ($home==1)) {
echo"<td style=\"text-align: justify\" valign=\"top\">\n"
. "<p class=storytitle style=\"margin-top: 5px; margin-bottom: 2px\"><b>$title</b></p>\n"
. "<font class=indexhometext>$story_pic$hometext</font> $story_link $print $com_link $tot_hits</td>\n";
if ($notes!="") {
echo"<td><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"4\"></td>\n"
."<td style=\"border-left-style: solid; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px\"><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"4\"></td>\n"
."<td valign=\"top\" width=\"30%\">$notes</td>\n";
}
} elseif (($newshome == 1) AND ($catnewshome==2) AND ($home==1)) {
if ($notes!="") {
echo"<td valign=\"top\" width=\"30%\">$notes</td>\n"
."<td><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"4\"></td>\n"
."<td style=\"border-left-style: solid; border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-width: 1px\"><img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"4\"></td>\n";
}
echo"<td style=\"text-align: justify\" valign=\"top\">\n"
. "<p class=storytitle style=\"margin-top: 5px; margin-bottom: 2px\"><b>$title</b></p>\n"
. "<font class=indexhometext>$story_pic$hometext</font> $story_link $print $com_link $tot_hits</td>\n";
} else {
echo"<td style=\"text-align: justify\">\n";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" id=\"table1\">\n";
echo "	<tr>\n";
echo "		<td class=\"A_bl\"><b>$title </b></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td><div align=\"justify\">$story_pic<font class=grey style=\"font-size: 9pt\">($datetime) </font>$hometext</div></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td>\n";
echo "		<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" id=\"table2\">\n";
echo "			<tr>\n";
echo "				<td align=\"left\">$story_link</td>\n";
echo "			</tr>\n";
echo "		</table>\n";
echo "		</td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td><hr color=\"#000000\" size=\"1\" style=\"border: 2px dotted #FFCC00\">$notes\n";
echo "		</td>\n";
echo "	</tr>\n";
echo "</table>\n";
echo"</td>";
}
echo"</tr></table></td></tr></table><br>";
}
/************************************************************/
/* Toan bo bai viet                     */
/************************************************************/
function themearticle ($aid, $time, $title, $hometext, $bodytext, $notes, $story_pic, $source) {
echo"<table border=\"0\" cellpadding=\"3\" cellspacing=\"3\" width=\"100%\">\n"
. "<tr>\n<td class=\"indexhometext\"><div class=\"storytitle\">$title</div>\n"
. "<p class=\"articlehometext\" align=\"justify\"><b>$story_pic$hometext</b>\n"
. "<p class=\"indexhometext\" align=\"justify\">$bodytext\n";
if($notes!="") {
OpenTable();
echo $notes;
CloseTable();
}
echo "<p align=\"right\"><b>$aid</b> $source</td>\n"
. "</tr>\n"
. "</table>\n<br>\n\n";
}
function themenewsst($title,$image,$hometext, $story_link) {
global $datafold;
OpenTable();
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"text-align: justify\" width=\"100%\">";
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"text-align: justify\">";
echo "<p class=storytitle style=\"margin-top: 0px; margin-bottom: 5px\">$title</p></td></tr>";
echo "<tr><td><center>$image</center></td></tr>";
echo "<tr><td><p class=indexhometext\" align=\"justify\">$hometext</td></tr>";
echo "</table>";
echo "</td><td width=\"5\">&nbsp;&nbsp;&nbsp;</td><td width=\"200\">";
//include("".INCLUDE_PATH."".$datafold."/Hotnews.php");
echo "</td></tr></table>"; 
CloseTable();
if (file_exists("".INCLUDE_PATH."banners/nvbanners/banners1_1176561711.php")) { 
include("".INCLUDE_PATH."banners/nvbanners/banners1_1176561711.php"); }
else { echo "&nbsp;"; } 
echo "<br>";
}
/************************************************************/
/* Blocks trai va phai                         */
/************************************************************/
function themesidebox($title, $content) {
global $block_side, $themepath, $bgcolor4;
if ($block_side == "l") {//BLOCK ben trai
echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "	<tr>\n";
echo "		<td height=\"3\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"3\"></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td class=\"A_white\" background=\"images/block113.jpg\" height=\"30\" style=\"padding-left: 5px\">\n";
echo "		$title</td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td height=\"1\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td style=\"border: 1px solid #529B0A; padding: 3px\" bgcolor=\"#ffffff\">\n";
echo "		$content</td>\n";
echo "	</tr>\n";
echo "</table>\n";
}
else {//BLOCK ben phai
echo "<table border=\"0\" width=\"100%\" cellpadding=\"0\" style=\"border-collapse: collapse\">\n";
echo "	<tr>\n";
echo "		<td class=\"A_white\" background=\"images/contact1_13.jpg\" height=\"30\" style=\"padding-left: 5px\" align=\"center\">\n";
echo "		$title</td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td height=\"1\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td bgcolor=\"#EFEFEF\" style=\"padding: 3px\">$content</td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td height=\"1\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td bgcolor=\"#d00f00\" height=\"2\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"2\"></td>\n";
echo "	</tr>\n";
echo "	<tr>\n";
echo "		<td height=\"3\">\n";
echo "		<img border=\"0\" src=\"".INCLUDE_PATH."themes/CKT/images/spacer.gif\" width=\"1\" height=\"3\"></td>\n";
echo "	</tr>\n";
echo "</table>\n";
}
}
/************************************************************/
/* Blocks giua                            */
/************************************************************/
function themecenterbox($title, $content) {
OpenTable_box();
echo"<left><b>$title</b></left></td></tr><tr><td>$content";
CloseTable();
}
/************************************************************/
/* Blocks giua-duoi                          */
/************************************************************/
function themecenterbox_d($title, $content) {
OpenTable();
echo"<center><b>$title</b></center><br>$content";
CloseTable();
}
/************************************************************/
/* Blocks giua 2 (Neu can)                          */
/************************************************************/
function themecenterbox2($title_2, $content_2) {
global $themepath;
OpenTable();
echo"<center><b>$title</b></center><br>$content";
CloseTable();
}

